#include "CText.h"

CText::CText()
{

}
int CText::loadFont(std::string fontPath)
{
	if(fontPath != "")
	{
		if(!textFont.loadFromFile(fontPath))
		{
			LOG(ERROR) << "Cannot load font from that path: " << fontPath;
			return 1;
		}
		else
		{
			LOG(INFO) << "Font loaded sucessfully: " << fontPath;
			text.setFont(textFont);
			

			return 0;
		}
		return -1;
	}	
	return -1;
}
void CText::draw(sf::RenderWindow &windowToBeDrawed)
{
	windowToBeDrawed.draw(text);
}
void CText::setText(std::string string)
{
	text.setString(string);
}
void CText::update()
{
	textPosition = text.getPosition();
	textScale = text.getScale();
}
void CText::setPosition(float x, float y)
{
	text.setPosition(x,y);
}
CText::~CText()
{

}